FROM postgres:alpine

LABEL maintainer="aetherus.zhou@gmail.com" \
      description="PostgreSQL + jieba 中文全文搜索"

RUN ["apk", "add", "--update", "alpine-sdk"]

RUN ["git", "clone", "https://github.com/jaiminpan/pg_jieba.git", "/usr/src/pg_jieba"]

WORKDIR /usr/src/pg_jieba

RUN USE_PGXS=1 make && USE_PGXS=1 make install

EXPOSE 5432

VOLUME /var/lib/postgresql/data
